package Basic.day03;

public class OperDemo03 {
    public static void main(String[] args) {
        // 逻辑运算符
        int a = 10;
        int b = 11;
        System.out.println((a > b) && (a++ < b)); // false && true
        System.out.println(a); // 10 --> 短路现象
        System.out.println((a > b) || (++a < b)); // false || false
        System.out.println(a); // 11
        System.out.println(!(a > b)); // !false

        System.out.println("--------------------");
        int c = 20;
        int d = 11;
        System.out.println((c > d) || (c++ < d)); // true || false，(a++ < b)不执行，a大小不变
        System.out.println(c); // 20
        System.out.println((c > d) && (c++ < d)); // true && false，(a++ < b)执行，a+1
        System.out.println(c); // 21
    }
}

